import { request } from "@/utils/request";

// 登录
export const login = (data) => {
	  return request({
		method: 'POST',
		data,
		url: '/wechat/sso/doLogin'
	})
}

// mock登录
export const mockLogin = (data) => {
	  return request({
		method: 'GET',
		data,
		url: '/pms-doctor/mock/login'
	})
}

// 获取带有用户头像和昵称的接口
export const getUserAvatarAndNickName = (data) => {
	  return request({
		method: 'GET',
		data,
		url: '/pms-doctor/getAvatar'
	})
}

// 获取手机号
export const getPhoneNumber = (data) => {
	return request({
		method: 'GET',
		data,
		url: `/wechat/sso/getPhoneNumber/${data.appId}`
	})
}

// 小程序登录获取Session
export const getSession = (data) => {
	return request({
		method: 'GET',
		data,
		url: `/wechat/sso/login/${data.appId}/${data.appType}`
	})
}

// 退出登录
export const logout = (data) => {
	return request({
		method: 'GET',
		data,
		url: `/wechat/sso/logout`
	})
}